package com.shopmall.common;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResponseData {
    private String code;

    private String msg;

    private Object data;

    public ResponseData success(Object data){
        return new ResponseData("200","成功",data);
    }

    public ResponseData failed(String msg){
        return new ResponseData("500",msg,null);
    }
    public ResponseData failed(String code,String msg){
        return new ResponseData(code,msg,null);
    }

}
